<?php
/**
获取全部小区
 */


namespace App\Http\Controllers\Property;

use App\Common\json;
use App\Http\Controllers\Controller;
use App\Libraries\upload;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;


class PlotController extends Controller{

    public function AllPlot(Request $request){
        if($request ->isMethod('post')){
            $city      = $request  ->input('city');
            $data       = DB::table('village')
                ->select('village_id','village_name')
                ->where('village_city',$city)
                ->where('village_operation',0)
                ->get();
            if($data == true){
                return json::json('success', '获取全部小区成功', $data);
            }else{
                return json::json('failure','由于网络或者不正当原因失败',json::value(2));
            }
        }else{
            return json::json('101','提交方式错误','');
        }
    }
}